package com.yixing.demo.service;

import com.yixing.demo.mapper.MusicMapper;
import com.yixing.demo.model.Music;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MusicService {
    @Autowired
    MusicMapper musicMapper;

    public Music inspectMusicIsExist(String title) {
        return musicMapper.inspectMusicIsExist(title);
    }

    public Integer insertMusic(String title, String singer, String time, String url, Integer userId) {
        return musicMapper.insertMusic(title, singer, time, url, userId);
    }

    public List<Music> seekMusicByName(String title) {
        return musicMapper.seekMusicByName(title);
    }

    public List<Music> seekMusicByNoName() {
        return musicMapper.seekMusicByNoName();
    }

    public Music inspectMusicIsExistById(Integer id) {
        return musicMapper.inspectMusicIsExistById(id);
    }

    public Integer deleteMusicById(Integer id) {
        return musicMapper.deleteMusicById(id);
    }
}
